import uuid
from typing import Tuple

from ctaf_facade.enumerations.exchange_enum import ExchangeEnum


def extract_ctaf_symbol(ctaf_symbol: str) -> Tuple[str, ExchangeEnum]:
    """
    :return: (symbol, exchange)
    """
    symbol, exchange_str = ctaf_symbol.rsplit(".", 1)
    return symbol, ExchangeEnum(exchange_str)


def generate_ctaf_symbol(symbol: str, exchange: ExchangeEnum) -> str:
    """
    return ctaf_symbol
    """
    return f"{symbol}.{exchange.value}"

#产生32位长的uuid
def generate_uuid() -> str:
    unique_id = str(uuid.uuid4()).replace('-', '')
    return unique_id